﻿<%@ Page Language="C#" %>

<%@ Import Namespace="AspNetCs.Common" %>
<%@ Import Namespace="AspNetCs.Bll" %>
<%@ Import Namespace=" AspNetCs.Model" %>

<script runat="server">
    protected string action = "";
    protected int id = 0;
    protected string path = "/";
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write("<!--\r\n");
        path = System_Lable.SystemGetCache.InstallDir;
        if (Request["Action"] != null)
        {
            action = StringHelper.HtmlEncrypt(Request["Action"].ToString()).Trim().ToLower();
        }
        if (Request["id"] != null)
        {
            id = StringHelper.isNumber_int(Request["id"].ToString());
        }
        switch (action)
        {
            case "selectuser"://查询用户
                Users_Model md = Users_Bll.CreatNew.GetModel(id);
                Response.Write("document.write('" + md.UserName + "');");
                break;
            case "usercount":
                Response.Write("var count=0;");
                Response.Write("myPlugin.UserCount();document.write(count);");
                break;
            case "memorialuser":
                Response.Write("var count1=0;");
                Response.Write("function MemorialCount(){");
                Response.Write("$.ajax({ ");
                Response.Write(" url:\"" + path + "AjaxXml/AjaxCount.aspx?channeltype=" + AspNetCs.Enumerations.Channel_Enum.Channel_Type.memorial.ToString() + "&id=\"+id,");
                Response.Write("         async:false, ");
                Response.Write("         type:\"post\", ");
                Response.Write("        dataType:\"html\",");
                Response.Write("       success:function(data){");
                Response.Write("          count1=data;");
                Response.Write("     } ");
                Response.Write("  }); ");
                Response.Write("};    ");
                Response.Write("MemorialCount();document.write(count1);");
                break;
            case "muuser":
                Response.Write("var count1=0;");
                Response.Write("function MuCount(){");
                Response.Write("$.ajax({ ");
                Response.Write(" url:\"" + path + "AjaxXml/AjaxCount.aspx?channeltype=" + AspNetCs.Enumerations.Channel_Enum.Channel_Type.gravestone.ToString() + "&id=\"+id,");
                Response.Write("         async:false, ");
                Response.Write("         type:\"post\", ");
                Response.Write("        dataType:\"html\",");
                Response.Write("       success:function(data){");
                Response.Write("          count1=data;");
                Response.Write("     } ");
                Response.Write("  }); ");
                Response.Write("};    ");
                Response.Write("MuCount();document.write(count1);");
                break;
            case "clancount":
                Response.Write("var countClan=0;");
                Response.Write("function ClanCount(){");
                Response.Write("$.ajax({ ");
                Response.Write(" url:\"" + path + "AjaxXml/AjaxCount.aspx?channeltype=" + AspNetCs.Enumerations.Channel_Enum.Channel_Type.clan.ToString() + "&id=\"+id,");
                Response.Write("         async:false, ");
                Response.Write("         type:\"post\", ");
                Response.Write("        dataType:\"html\",");
                Response.Write("       success:function(data){");
                Response.Write("          countClan=data;");
                Response.Write("     } ");
                Response.Write("  }); ");
                Response.Write("};    ");
                Response.Write("ClanCount();document.write(countClan);");
                break;

        }

        Response.Write("\r\n//-->");

    }
    
</script>

myPlugin ={ UserCount:function(){ $.ajax({ url:"<%=path %>AjaxXml/AjaxCount.aspx?channeltype=<%=AspNetCs.Enumerations.Channel_Enum.Channel_Type.cemetery %>&id="+id,
async:false, type:"post", dataType:"html", success:function(data) { count=data;
} }); } };